//
//  LGRecoverySectionTitleView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/7/31.
//

#import "LGRecoverySectionView.h"

@interface LGRecoverySectionView()
/**   */
@property (nonatomic , strong)UIView *iconView;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;

@end

@implementation LGRecoverySectionView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.iconView];
        [self addSubview:self.titleLabel];
        [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(viewPix(16));
            make.centerY.equalTo(self);
            make.width.equalTo(@(viewPix(4)));
            make.height.equalTo(@(viewPix(14)));
        }];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.iconView.mas_right).offset(viewPix(12));
            make.right.equalTo(self).offset(-viewPix(16));
            make.centerY.equalTo(self);
        }];
    }
    return self;
}

-(void)setTitle:(NSString *)title{
    _title = title;
    self.titleLabel.text = title;
}

-(UIView *)iconView{
    if(!_iconView){
        _iconView = [[UIView alloc]init];
        _iconView.backgroundColor = [UIColor colorWithString:@"#77D4C6"];
        _iconView.cornerRidus = viewPix(2);
    }
    return _iconView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(16, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _titleLabel;
}

@end
